<?php
/**
 * Controles pour les paginators
 * @package bp-clients
 */

$choixParPage = array(1, 5, 10, 20, 50);
?>
 
<?php if ($this->pageCount): ?>
<nav>
<!-- Nombre de lignes par page -->
Afficher
<?php foreach ($choixParPage as $choix): ?>
  <?php if ($choix < $this->totalItemCount): ?>
    <?php if ($choix != $this->itemCountPerPage): ?>
      <a href="<?php echo $this->url(array('parpage' => $choix)); ?>">
          <?php echo $choix; ?></a>&nbsp;
    <?php else: ?>
      <span class="disabled"><?php echo $choix; ?></span>&nbsp;
    <?php endif; ?>
  <?php endif; ?>
<?php endforeach; ?>
<?php if ($this->itemCountPerPage != $this->totalItemCount): ?>
  <a href="<?php echo $this->url(array('parpage' => 0)); ?>">
    <?php echo $this->totalItemCount . "(tous)"; ?></a>
<?php else: ?>
  <span class="disabled"><?php echo $this->totalItemCount . "(tous)"; ?></span>
<?php endif; ?>
élements&nbsp;&nbsp;

<?php if ($this->pageCount>1): ?>
    
    <!-- Page précédente -->
    <?php if (isset($this->previous)): ?>
      <a href="<?php echo $this->url(array('page' => $this->first)); ?>">&lt;&lt;</a>&nbsp;&nbsp;
      <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">
        &lt;</a>&nbsp;
    <?php else: ?>
      <span class="disabled">&lt;&lt;</span>&nbsp;&nbsp;
      <span class="disabled">&lt;</span>&nbsp;
    <?php endif; ?>
     
    <!-- Numéros de pages -->
    <?php foreach ($this->pagesInRange as $page): ?>
      <?php if ($page != $this->current): ?>
        <a href="<?php echo $this->url(array('page' => $page)); ?>">
            <?php echo $page; ?></a>&nbsp;
      <?php else: ?>
        <?php echo $page; ?>&nbsp;
      <?php endif; ?>
    <?php endforeach; ?>
     
    <!-- Page suivante -->
    <?php if (isset($this->next)): ?>
      <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
        &gt;</a>&nbsp;&nbsp;
      <a href="<?php echo $this->url(array('page' => $this->last)); ?>">&gt;&gt;</a>
    <?php else: ?>
      <span class="disabled">&gt;</span>&nbsp;&nbsp;
      <span class="disabled">&gt;&gt;</span>&nbsp;
    <?php endif; ?>
</nav>
<?php endif; ?>
<?php endif; ?>
